package com.javaee.term.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.javaee.term.Enums.ContactStatusEnum;
import com.javaee.term.utils.EnumUtil;
import lombok.Data;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Date;


/**
 * author 陈伯瑞
 * date 2019/12/15 0015 21:35
 * version 1.0
 **/

@Data
public class ContactDto {

    private String contactId;

    private String customerId;

    private Integer manId;

    /**
     * 合同履行状态, 默认为未履行
     */
    private Integer performanceStatus;

    /**
     * 总价格
     */
    private BigDecimal contactMoney;

    /**
     * 创建时间
     */

    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    private String customerName;

    private String customerPhone;

    private String customerAddress;

    @JsonIgnore
    public  String getStringCreate(){
        DateFormat df5_1 = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
        return  df5_1.format(createTime);
    }


    @JsonIgnore
    public ContactStatusEnum getContactStatusEnum() {
        return EnumUtil.getByCode(performanceStatus, ContactStatusEnum.class);
    }

}
